/**
 * 
 */
package habitcoach.core.reminder;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Coddy created on 2010-4-25
 * 
 */
public class DateChangeEventPublisherImpl implements DateChangeEventPublisher
{
	private List<DateChangeEventListener> listeners;

	public DateChangeEventPublisherImpl()
	{
		super();
		listeners = new ArrayList<DateChangeEventListener>();
	}

	@Override
	public void addListerner(DateChangeEventListener listener)
	{
		listeners.add(listener);
	}

	@Override
	public void removeListener(DateChangeEventListener listener)
	{
		listeners.remove(listener);
	}

	@Override
	public void update()
	{
		for (int i = 0; i < listeners.size(); i++)
		{
			listeners.get(i).onDateChanged();
		}
	}

	List getListeners()
	{
		return listeners;
	}

}
